<?php

namespace app\model\questionnaire;

use app\BaseModel;
use think\model\relation\BelongsTo;

/**
 * 问卷-试卷题目
 */
class QuestionnairePaperTopicModel extends BaseModel
{
    protected $name = 'questionnaire_paper_topic';

    /**
     * 题目
     * @return BelongsTo
     */
    public function topic(): BelongsTo
    {
        return $this->belongsTo(QuestionnaireTopicModel::class,'topic_id');
    }

    /**
     * 题目
     * @return BelongsTo
     */
    public function topic2(): BelongsTo
    {
        return $this->belongsTo(QuestionnaireTopicModel::class,'topic_id')->bind([
            'type',
            'score',
            'content',
            'reference_answer',
            'method',
            'method_score',
            'answer',
            'pass_score'
        ]);
    }
}